/* This file is part of MyRename
 * Copyright (C) 2005-2009 Kai-Chieh Ku (kjackie@gmail.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#pragma once

#define CFN_FOLDER		0x0001u
#define CFN_HIDDEN		0x0002u
#define CFN_READONLY	0x0004u
#define CFN_SYSTEM		0x0008u

#define FHRS(f, h, r, s) (((f) ? CFN_FOLDER : 0) | ((h) ? CFN_HIDDEN : 0) | \
		((r) ? CFN_READONLY : 0) | ((s) ? CFN_SYSTEM : 0))

class CFileName
{
public:
	CFileName();
	CFileName(LPCTSTR fn, uint16 attr = 0);
	CFileName(CFileName &fn);
	virtual ~CFileName();

	LPCTSTR GetType(const __int8 _case = 0);
	LPCTSTR GetTitle(const __int8 _case = 0);
	LPCTSTR GetName() const;
	bool isHidden() const;
	bool isSystem() const;
	bool isReadOnly() const;
	bool isFolder() const;
	operator LPCTSTR();
	CFileName& operator =(CFileName &src);
	CFileName& operator =(LPCTSTR src);
	void setFileName(LPCTSTR fn, uint16 attr = 0);
	uint16 m_attribute;
	int m_iIcon;
	void clear();
private:
	LPTSTR filename;
	LPTSTR title;
	LPTSTR ext;
public:
	static CString folder;
};
